<?php

namespace App\Http\Controllers\Backend\Api\V1;

use App\Http\Requests\Backend\SpaceSchemeContentCategoryRequest;
use App\Services\Gallery\Interfaces\SpaceSchemeContentCategoryServiceInterface;
use App\Services\Gallery\Services\SpaceSchemeContentCategoryService;
use Illuminate\Http\Request;

class SpaceSchemeContentCategoryController extends BaseController
{
    /**
     * @var SpaceSchemeContentCategoryService
     */
    protected $SpaceSchemeContentCategoryService;

    public function __construct(SpaceSchemeContentCategoryServiceInterface $SpaceSchemeContentCategoryService)
    {
        $this->SpaceSchemeContentCategoryService = $SpaceSchemeContentCategoryService;
    }

    public function index(Request $request)
    {
        $space_scheme_content_category = $this->SpaceSchemeContentCategoryService->index($request->all());
        return $this->successData($space_scheme_content_category);
    }

    public function store(SpaceSchemeContentCategoryRequest $request)
    {
        $this->SpaceSchemeContentCategoryService->set($request->filldata());
        return $this->success();
    }

    public function edit($id)
    {
        $space_scheme_content_category = $this->SpaceSchemeContentCategoryService->get($id);
        return $this->successData(compact('space_scheme_content_category'));
    }

    public function contentedit($id)
    {
        $space_scheme_content_category = $this->SpaceSchemeContentCategoryService->getcontent($id);
        return $this->successData(compact('space_scheme_content_category'));
    }

    public function update(SpaceSchemeContentCategoryRequest $request, $id)
    {
        $this->SpaceSchemeContentCategoryService->set($request->filldata(), $id);
        return $this->success();
    }

    public function destroy($id)
    {
        $this->SpaceSchemeContentCategoryService->destroy($id);
        return $this->success();
    }
}
